package com.lai.ndktest;


import android.annotation.SuppressLint;
import android.app.Activity;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;

import com.ir.ykzteencoder.R;
import com.yaokan.devices.ir;

public class MainActivity extends Activity {

	private static final String TAG = "MainActivity";
	Button button1;
	Button button2;
	
	MainActivity mAc;
	@SuppressLint("NewApi")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		
		mAc = this;

		button1 = (Button) findViewById(R.id.button1);
		// button2 = (Button) findViewById(R.id.button2);
		
		button1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
//				String token="9876543210";
//				String encode="B8R[UUS2LEM8HGX4YL1C[8[L5]B2ED9QS6QN3]M0YT7[O4KT1CK8CJ5OO2ID9WU6KD3GS0IZ7]H4W\\1CU8EH5E[2MD9CW6ET3OW0SF7WC4IJ1CE8GF5UM2QD9IY6YJ3W[0CL7UW4UR1CO8ID5OW2UD9O[6SZ3EE0MR7SQ4GZ1CY8K\\5[K2YD9UC6MP3QH0WX7QK4SH1GG8MZ5QW2CD9[E6GF3YK0GD7OF4EP1HRE7WD4MG1CF8KC5UN2QC9IZ6YI3W\\0CK7UX4UQ1CP8IC5KZ2UC9O\\6SY3EF0MQ7SR4GY1CZ8K[5[L2YC9UD6QM3MJ0WW7QL4SG1CJ8MY5QX2CC9[F6GE3UN0GC7OF4EO1CT8OW5GJ2GC9GH6[U3CR0QI7MZ4QW1CD8QU5WV2KC9MJ6UK3KV0[O7KT4CE1CN8WR5MH";
				//encode= "1,38000,340,165,23,22,23,61,23,22,23,60,23,22,23,22,23,22,23,22,23,22,23,61,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,60,23,22,23,22,23,22,23,22,23,22,23,22,23,61,23,22,23,60,23,22,23,22,23,60,23,23,23,712,23,60,23,60,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,60,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,22,23,61,23";
				//ir.transmit(token, encode);
				// ir.test(mAc);
				ir.getInstance().irtest(mAc);
			}
		});
		
		/*button2.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				String aa  = ""; //testFunction();
				Log.e("Main", "Get from jni: " + aa );
			}
		});*/
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}


	//private native void helloLog(String ss);
	//private native String testFunction(); 
	
//	static {
//	    System.loadLibrary("encode");
//	}  
}
